import request from "@/utils/request";

// 获取在读和历史学员列表
export const getStudentsList = (params) => {
  return request({
    url: "/student/list",
    method: "get",
    params,
  });
};
// 获取报读情况学员列表
export const getEnrollmentStudentsList = (params) => {
  return request({
    url: "/student/enrollmentStatus",
    method: "get",
    params,
  });
};
// 获取剩余课消金额、课时总数
export const remainderCount = (params) => {
  return request({
    url: "/student/remainderCount",
    method: "post",
    data: params,
  });
};

// 获取跟进学员列表
export const getFollowList = (params) => {
  return request({
    url: "/student/followList",
    method: "get",
    params,
  });
};
// 获取单独学员
export const getStudentsInfo = (params) => {
  return request({
    url: "student/getStudent",
    method: "post",
    data: params,
  });
};
// 查询已报名的学员
export const getAllStudent = (params) => {
  return request({
    url: "student/allStudent",
    method: "post",
    data: params,
  });
};
// 查询所有学员
export const getAllStudentList = (params) => {
  return request({
    url: "student/allStudentList",
    method: "post",
    data: params,
  });
};
//获取工作人员列表
export const getStaffList = (params) => {
  return request({
    url: "/institution/staffStudent/listStaff",
    method: "get",
    params,
  });
};

//获取学员来源下拉列表
export const getJoinWayList = (params) => {
  return request({
    url: "/system/dict/data/type/student_source",
    method: "get",
  });
};
//获取跟进阶段下拉列表
export const getFollowPhase = (params) => {
  return request({
    url: "/system/dict/data/type/follow_phase",
    method: "get",
  });
};
//获取跟进方式下拉列表
export const getFollowMethods = (params) => {
  return request({
    url: "/system/dict/data/type/follow_methods",
    method: "get",
  });
};
//获取工作人员下拉列表
export const getPeopleList = (params) => {
  return request({
    url: "/institution/staffStudent/peopleList",
    method: "post",
    data: params,
  });
};
//获取业绩归属人下拉列表
export const getPerformanceList = (params) => {
  return request({
    url: "/institution/staffStudent/performanceList",
    method: "post",
    data: params,
  });
};
//获取学管师下拉列表
export const getManagerList = (params) => {
  return request({
    url: "/institution/staffStudent/managerList",
    method: "get",
    params,
  });
};
//获取跟进人列表和学员创建人下拉列表
export const getFollowPeopleList = (params) => {
  return request({
    url: "/institution/staffStudent/followPeopleList",
    method: "get",
    params,
  });
};
//获取在职的跟进人下拉列表
export const getPeopleJobList = (params) => {
  return request({
    url: "/institution/staffStudent/peopleJobList",
    method: "get",
    params,
  });
};
//获取在职的学管师下拉列表
export const getManagerJobList = (params) => {
  return request({
    url: "/institution/staffStudent/managerJobList",
    method: "get",
    params,
  });
};

//获取班级老师下拉列表
export const getTeacherList = (params) => {
  return request({
    url: "/institution/staffStudent/teacherList",
    method: "post",
    data: params,
  });
};
//获取年级下拉列表
export const getGradeList = (params) => {
  return request({
    url: "/student/gradeList",
    method: "post",
    data: params,
  });
};
//获取所在班级下拉列表
export const getClassList = (params) => {
  return request({
    url: "/student/classList",
    method: "post",
    data: params,
  });
};

//分配学员
export const getAssignStudents = (params) => {
  return request({
    url: "student/getCounselor",
    method: "post",
    data: params,
  });
};
//分配学员
export const editStudents = (params) => {
  return request({
    url: "/student/save",
    method: "post",
    data: params,
  });
};
//报名回显接口
export const getStudentInfo = (params) => {
  return request({
    url: "/student/applicationOne",
    method: "post",
    data: params,
  });
};
//课程列表
export const getLessonList = (params) => {
  return request({
    url: "/tCourse/list",
    method: "get",
    params,
  });
};
//转为历史学员
export const changeGraduation = (params) => {
  return request({
    url: "/student/changeGraduation",
    method: "post",
    data: params,
  });
};
//转为线索学员
export const changeIntention = (params) => {
  return request({
    url: "/student/changeIntention",
    method: "post",
    data: params,
  });
};
//转为在读学员
export const changeLearning = (params) => {
  return request({
    url: "/student/changeLearning",
    method: "post",
    data: params,
  });
};
//导入学员
export const toImport = (params) => {
  return request({
    url: "/student/import",
    method: "post",
    data: params,
  });
};
//导出学员
export const toExport = (data) => {
  return request({
    method: "post",
    url: "/student/export",
    responseType: "blob",
    headers: { "Content-Type": "application/json; application/octet-stream" },
    data: data,
  });
};
//导出报读情况
export const toEenrollExport = (data) => {
  return request({
    method: "post",
    url: "student/enrollExport",
    responseType: "blob",
    headers: { "Content-Type": "application/json; application/octet-stream" },
    data: data,
  });
};
//下载模板
export const toExportTemplate = (params) => {
  return request({
    method: "get",
    url: "/student/exportInfo",
    responseType: "blob",
    headers: { "Content-Type": "application/json; application/octet-stream" },
    params,
  });
};
//报名
// export const toApplication = params => {
//     return request({
//         url: '/student/application',
//         method: 'post',
//         data: params
//     });
// };
export const toApplication = (params) => {
  return request({
    url: "tStudentCourse/application",
    method: "post",
    data: params,
  });
};
//回收站
export const deleteClue = (params) => {
  return request({
    url: "/student/deleteClue",
    method: "post",
    data: params,
  });
};

//将学员跟进人转为账号登录人
export const cluefollow = (params) => {
  return request({
    url: "/student/cluefollow",
    method: "post",
    data: params,
  });
};
//添加跟进记录
export const followSave = (params) => {
  return request({
    url: "/student/followSave",
    method: "post",
    data: params,
  });
};
//将跟进人员放入回收站
export const followDelete = (params) => {
  return request({
    url: "/student/followDelete",
    method: "post",
    data: params,
  });
};
//将跟进人员放入回收站
export const followDeleteRecord = (params) => {
  return request({
    url: "/student/followDeleteRecord",
    method: "post",
    data: params,
  });
};
//获取学员跟进记录
export const followListById = (params) => {
  return request({
    url: "/student/followListById",
    method: "post",
    data: params,
  });
};

//获取上课班级下拉列表
export const getBeginClassList = (params) => {
  return request({
    url: "/tClass/list",
    method: "get",
    params,
  });
};
//获取试听课程列表
export const getTrailList = (params) => {
  return request({
    url: "tCourseOrder/orderFilterList",
    method: "get",
    params,
  });
};
//试听报名
export const addAudition = (params) => {
  return request({
    url: "/tCourseOrder/addStudent",
    method: "post",
    data: params,
  });
};
//试听记录列表
export const auditionList = (params) => {
  return request({
    url: "/auditionCourse/auditionList",
    method: "get",
    params,
  });
};
//取消试听
export const cancelAudition = (params) => {
  return request({
    url: "/auditionCourse/cancelAudition",
    method: "post",
    data: params,
  });
};
//财务中心---------------------------------------------------------------------------------
//订单列表
export const getOrderList = (params) => {
  return request({
    url: "/tStudentCourse/list",
    method: "get",
    params,
  });
};
//订单详情
export const getOrderDetails = (params) => {
  return request({
    url: "tStudentCourse/detail",
    method: "post",
    data: params,
  });
};
//实收总计
export const getSumAmount = (params) => {
  return request({
    url: "tStudentCourse/sumAmount",
    method: "post",
    data: params,
  });
};
//获取学员的报读课程列表
export const getCourseList = (params) => {
  return request({
    url: "tStudentCourse/courseList",
    method: "post",
    data: params,
  });
};
//获取学员所报读课程对应的订单列表
export const getCourseOrderList = (params) => {
  return request({
    url: "tStudentCourse/courseOrderList",
    method: "post",
    data: params,
  });
};
//退课
export const refundOrderAPI = (params) => {
  return request({
    url: "tStudentCourse/refundOrder",
    method: "post",
    data: params,
  });
};
//转课
export const transferOrderAPI = (params) => {
  return request({
    url: "tStudentCourse/transferOrder",
    method: "post",
    data: params,
  });
};
//学员详情 报读课程列表
export const getIstSecond = (params) => {
  return request({
    url: "/tStudentCourse/listSecond",
    method: "post",
    data: params,
  });
};
//课时清零
export const updateLesson = (params) => {
  return request({
    url: "/tStudentCourse/update",
    method: "post",
    data: params,
  });
};
//结课
export const classEndingApi = (params) => {
  return request({
    url: "tStudentCourse/classEnding",
    method: "post",
    data: params,
  });
};
//停复课
export const stopsAndResumeApi = (params) => {
  return request({
    url: "tStudentCourse/stopsAndResume",
    method: "post",
    data: params,
  });
};
//业绩归属人修改
export const updateSaler = (params) => {
  return request({
    url: "tStudentCourseSale/update",
    method: "post",
    data: params,
  });
};
//超上处理
export const dealExceed = (params) => {
  return request({
    url: "tStudentCourse/dealExceed",
    method: "post",
    data: params,
  });
};
//新建课次
export const addClassTimes = (params) => {
  return request({
    url: "auditionCourse/startClassAudition",
    method: "post",
    data: params,
  });
};
//试听班课联动
export const getClassCourseList = (params) => {
  return request({
    url: "student/classCourseList",
    method: "post",
    data: params,
  });
};
//学员详情页报读课程给学员分配班级
export const addStudentToClass = (params) => {
  return request({
    url: "/tClass/addStudentToClassSecond",
    method: "post",
    data: params,
  });
};
